function singleton() {

    let instance;

    return (newInstance) => {

        if (newInstance) {

            instance = newInstance;
        }

        return instance;
    }

};

export default singleton